home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Aug 89 / X0117-Re[2] Memory Manage-Aug89 < prev    next >
Encoding:
Text File  |  1989-08-30  |  1.5 KB  |  52 lines  |  [TEXT/GEOL]

  1. Item    4722459                         30-Aug-89        03:33
  2.  
  3. From:   AU0008                          Kopfwerk EDV SW Entwicklung
  4.  
  5. To:     ALGER                           Alger, Jeff,VCA
  6.         MACAPP.TECH$                    MACAPP Tech
  7.  
  8. Sub:    Re:Re:Memory Management
  9.  
  10. Jeff,
  11.  
  12. thank you for reply to my memory management problems. I did the implementation
  13. how you suggested. I added in implementation part of UInspector (file:
  14. …MacApp:Libraries:UInspector.inc1.p) EachObjectForClass and
  15. ComputeSizeForClass. Then I modified the Interface part of UInspector (file:
  16. …MacApp:Interfaces:PInterfaces:UInspector.p) to have ComputeSizeForClass
  17. public. In my program there is a procedure WriteSizeOfObject which prints the
  18. size for every class and the sum of these in the transcript window.
  19.  
  20. {$IFC qDebug}
  21. PROCEDURE WriteSizeOfObjects;
  22. VAR
  23.     sumSize: LONGINT;
  24.  
  25.        PROCEDURE WriteSizeOfClass (theClass: ObjClassID);
  26.        VAR
  27.            theSize, howMany: LONGINT;
  28.            theName : MAName;
  29.  
  30.        BEGIN
  31.            theSize:= ComputeSizeForClass (theClass, howMany);
  32.            sumSize:= sumSize + theSize;
  33.            if (theSize <> 0) OR (howMany <> 0) THEN
  34.            BEGIN
  35.                GetClassNameFromID (theClass, theName);
  36.                writeln ('Size: ',theSize:6,' # = ', howMany:2,' Class: ',theNam
  37.            END;
  38.        END;
  39.  
  40. BEGIN
  41.        sumSize:= 0;
  42.        EachClassDo (WriteSizeOfClass);
  43.        writeln ('### size of ALL objects: ',sumSize);
  44.        writeln;
  45. END;
  46. {$ENDC}
  47.  
  48. It works fine and is exactly what I need.
  49.  
  50. Tommi.
  51.  
  52.